home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business Assistant
/
Business Assistant.iso
/
indus
/
rental
/
maintain.prg
< prev
next >
Wrap
Text File
|
1986-05-30
|
13KB
|
425 lines
** Last revision: May 26, 1986 at 15:15
* maintain.prg
STOR .t. TO more
DO WHIL more
STOR '?' TO command
CLEA
IF clipper
@ 0,0, 22, 79 BOX frame
@ 4,1 SAY line1
@ 19,1 SAY line1
ELSE
@ 0,0 TO 4,79
@ 0,0 TO 19,79
@ 0,0 TO 22,79 DOUBLE
ENDI
@ 20,5 SAY 'Please select one of the above options. You may also leave this menu'
@ 21,5 SAY "by typing 'Q' and get on-line HELP by typing '?'."
@ 02,04 SAY dconame + " - FILE MAINTENANCE MENU"
@ 02,65 SAY DTOC(DATE())
@ 07,24 SAY 'A. Backup data files'
@ 08,24 SAY 'B. Browse through building file'
@ 09,24 SAY 'C. Browse through tenant file'
@ 10,24 SAY 'D. Display building file'
@ 11,24 SAY 'E. Display tenant file'
@ 12,24 SAY 'F. First initialization of Property Manager Program'
@ 13,24 SAY 'G. Change company name or default drive'
@ 14,24 SAY 'H. Purge building and tenant file'
@ 15,24 SAY 'I. Re-index the records into all indexes'
@ 16,24 SAY 'J. Return to main menu'
@ 18,23 SAY "PLEASE SELECT ONE OF THE OPTIONS"
@ 18,58 GET command PICTURE '!'
READ
DO WHIL AT(COMMAND, 'ABCDEFGHIJ?*Q') = 0
STOR '?' TO command
@ 18,58 GET command PICTURE '!'
READ
ENDD
DO CASE
CASE command = 'A'
STOR 'Y' TO doit
CLEA
@ 01,05 SAY 'This module makes a backup of the DATA Files to another disk'
@ 03,05 SAY 'Do you want to do a backup of the DATA Files (Y/N) ?'
@ 03,60 GET doit PICTURE '!'
READ
IF doit = 'Y'
@ 01,00
@ 03,00
@ 03,05 SAY 'The left drive is Drive A - The right drive is Drive B'
@ 04,05 SAY 'The DATA File is on drive '+dr+' and you normally backup to drive B'
@ 06,05 SAY 'Make sure the backup disk is in the drive selected for backup'
STOR 'B' TO bdr
@ 08,05 SAY 'Which drive selected for backup DATA File ? ' GET bdr PICTURE '!'
READ
DO WHIL AT(bdr,'ABCD') = 0
@ 08,05 SAY 'Which drive selected for backup DATA File ? ' GET bdr PICTURE '!'
READ
ENDD while @
IF bdr <> dr
@ 10,05 SAY 'Now copying DATA Files from drive '+dr+' to drive '+bdr+ ' '
SET ECHO ON
SET TALK ON
SELE A
USE &dr.:build INDEX &dr.:code
COPY TO &bdr.:buildbak
SELE B
USE &dr.:tenant INDEX &dr.:codea
COPY TO &bdr.:tenbak
SET TALK OFF
SET ECHO OFF
SELE A
USE &dr.:build INDEX &dr.:code
ELSE
@ 10,05 SAY "Can't backup to same drive - Aborting"
@ 12,00 SAY 'Hit RETURN to Continue'
SET CONSOLE OFF
WAIT
SET CONSOLE ON
ENDI not same drive
ENDI do backup
LOOP
CASE command = 'B'
IF .NOT. clipper
* browse thru records
CLEA
@ 01,12 SAY '***WARNING*** ***WARNING*** ***WARNING***'
@ 03,13 SAY 'Changes made will be written to the File'
@ 06,12 SAY 'CTRL-C write current record & go down'
@ 07,12 SAY 'CTRL-R write current record & go up'
@ 08,12 SAY 'CTRL-Z/B pans screen left or right'
@ 09,12 SAY 'CTRL-V toggles Insert on or off'
@ 10,12 SAY 'CTRL-G Delete character under cursor'
@ 11,12 SAY 'CTRL-U Delete or Recall current record'
@ 12,12 SAY "CTRL-Q exit Don't Write Current record"
@ 13,12 SAY 'CTRL-W exit and Save all changes'
* get a starting point in file
STOR ' ' TO stletter
@ 15,12 SAY 'We are using the building code index to browse'
@ 16,12 SAY '....so please tell me the starting code number'
@ 17,12 SAY 'or as much of it as you want to.'
@ 19,12 SAY ' Where shall we start.............'
@ 19,57 Get stletter PICTURE '99'
@ 22,00
READ
STOR TRIM(stletter) TO stletter
* goto starting point or next if no find
SEEK stletter
IF (EOF() .OR. BOF())
GO top
ENDI
* browse thru file
SET ESCAPE OFF
BROW fields bcode, baddr
* commented out for compile
SET ESCAPE ON
ELSE
CLEAR
@ 17,24 SAY 'Function not available in Clipper'
@ 18,23 SAY ' PLEASE HIT ANY KEY TO CONTINUE '
SET CONSOL OFF
WAIT
SET CONSOL ON
ENDI
LOOP
CASE command = 'C'
IF .NOT. clipper
CLEA
SELE B
USE &dr.:tenant INDEX &dr.:codea
* browse thru records
CLEA
@ 01,12 SAY '***WARNING*** ***WARNING*** ***WARNING***'
@ 03,13 SAY 'Changes made will be written to the File'
@ 06,12 SAY 'CTRL-C write current record & go down'
@ 07,12 SAY 'CTRL-R write current record & go up'
@ 08,12 SAY 'CTRL-Z/B pans screen left or right'
@ 09,12 SAY 'CTRL-V toggles Insert on or off'
@ 10,12 SAY 'CTRL-G Delete character under cursor'
@ 11,12 SAY 'CTRL-U Delete or Recall current record'
@ 12,12 SAY "CTRL-Q exit Don't Write Current record"
@ 13,12 SAY 'CTRL-W exit and Save all changes'
* get a starting point in file
STOR ' ' TO stletter
@ 15,12 SAY 'We are using the building code index to browse'
@ 16,12 SAY '....so please tell me the starting code number'
@ 17,12 SAY 'or as much of it as you want to.'
@ 19,12 SAY ' Where shall we start.............'
@ 19,57 Get stletter PICTURE '99999'
@ 22,00
READ
STOR TRIM(stletter) TO stletter
* goto starting point or next if no find
SEEK stletter
IF (EOF() .OR. BOF())
GO top
ENDI
* browse thru file
SET ESCAPE OFF
BROW fields bcode, tunit, tenant
* commented out for compile
SET ESCAPE ON
SELE A
USE &dr.:build INDEX &dr.:code
ELSE
CLEAR
@ 17,24 SAY 'Function not available in Clipper'
@ 18,23 SAY ' PLEASE HIT ANY KEY TO CONTINUE '
SET CONSOL OFF
WAIT
SET CONSOL ON
ENDI
LOOP
CASE command = 'D'
CLEA
@ 02,12 SAY 'Records are displayed by code number and you can select the '
@ 03,12 SAY 'starting code letter or any part of it. If I do not find that'
@ 04,12 SAY 'number in the file, I will start at the beginning'
@ 06,12 SAY 'When WAITING hit space bar to continue... or ESCape to quit'
* get a starting point in file
STOR ' ' TO stletter
@ 10,12 SAY 'Place at which to start display'
@ 10,57 Get stletter PICTURE '99'
READ
STOR TRIM(stletter) TO stletter
* goto starting point or next if no find
SEEK stletter
IF (EOF() .OR. BOF())
GO top
ENDI
* display selected list
CLEA
SET ESCAPE OFF
DISP NEXT 65000 bcode, SUBSTR(bdata,1,38), SUBSTR(baddr,1,20)
IF EOF()
WAIT
ENDI
SET ESCAPE ON
LOOP
CASE command = 'E'
SELE B
USE &dr.:tenant INDEX &dr.:codea
CLEA
@ 02,12 SAY 'Records are displayed by code number and you can select the '
@ 03,12 SAY 'starting code letter or any part of it. If I do not find that'
@ 04,12 SAY 'number in the file, I will start at the beginning'
@ 06,12 SAY 'When WAITING hit space bar to continue... or ESCape to quit'
* get a starting point in file
STOR ' ' TO stletter
@ 10,12 SAY 'Place at which to start display'
@ 10,57 Get stletter PICTURE '99999'
READ
STOR TRIM(stletter) TO stletter
* goto starting point or next if no find
SEEK stletter
IF (EOF() .OR. BOF())
GO top
ENDI
* display selected list
CLEA
SET ESCAPE OFF
DISP NEXT 65000 bcode, tunit, ttype, tenant
IF EOF()
WAIT
ENDI
SET ESCAPE ON
SELE A
USE &dr.:build INDEX &dr.:code
LOOP
CASE command = 'F'
CLEA
STOR 'N' TO option
TEXT
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
W A R N I N G W A R N I N G W A R N I N G
============= ================== ==============
This option is designed to create a new data base file to
startup this program the first time. It will mark for
deletion all of the sample files we gave you in the build-
ing and tenant databases. Then add your records and come
back to the maintenance menu to purge. A similar program
is found on the Accounting Maintenance menu.
NEVER RUN THIS OPTION UNLESS YOU HAVE BACKED UP THE PROGRAM
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
ENDT
@ 19,20 SAY 'ARE YOU READY TO PROCEED'
@ 19,47 GET option PICTURE '!'
READ
IF option = 'Y'
SELE B
U